import React, { Component } from 'react'

export default class Child7 extends Component {
    constructor(props){
        super(props);
        this.state={
            string:""
        }
    }
  render() {
    return (
      <div>子组件1要发送的值是<input ref="str"></input><button onClick={()=>{
          this.setState({
              string:this.refs.str.value
          },()=>{this.props.add(this.state.string)})
      }}>点击发送给子组件2</button></div>
    )
  }
}
